import requests
import json

url = "https://test.shanggewangwl.com/prod/saimulti/system/organization/save"

data = [
    {"name": "百闻思享", "package": "com.zycl.baiwensixiang"},
    {"name": "便知", "package": "com.rkzx.bianzhi"},
    {"name": "低吟赏韵", "package": "com.xysj.diyinshangyun"},
    {"name": "丰郇", "package": "com.zxhc.fengxun"},
    {"name": "风雅", "package": "com.yymx.fengya"},
    {"name": "广聚", "package": "com.ylq.guangju"},
    {"name": "宏途", "package": "com.ldcx.hongtu"},
    {"name": "绘知趣览", "package": "com.zl.huizhiqulan"},
    {"name": "慧览", "package": "com.hjxh.huilan"},
    {"name": "慧智通", "package": "com.fsyc.huizhitong"},
    {"name": "居萃", "package": "com.hyt.jucui"},
    {"name": "快晓", "package": "com.mqyc.kuaixiao"}
]
apps = [
    # fsyc 组
    {"name": "畅优", "package": "com.fsyc.changyou"},
    {"name": "炽穹", "package": "com.fsyc.chiqiong"},
    {"name": "浮光记", "package": "com.fsyc.fuguangj"},
    {"name": "花伴", "package": "com.fsyc.huabai"},
    {"name": "慧智通", "package": "com.fsyc.huizhitong"},
    {"name": "简感", "package": "com.fsyc.jiangan"},

    # hyt 组
    {"name": "百宝", "package": "com.hyt.baibao"},
    {"name": "枫迅", "package": "com.hyt.fengxun"},
    {"name": "幻启", "package": "com.hyt.huanqi"},
    {"name": "锦章", "package": "com.hyt.jinzhang"},
    {"name": "居萃", "package": "com.hyt.jucui"},
    {"name": "灵跃求知", "package": "com.hyt.lingyueqiuzhi"},

    # hjxh 组
    {"name": "畅晓", "package": "com.hjxh.changxiao"},
    {"name": "潮闻", "package": "com.hjxh.chaowen"},
    {"name": "慧畅", "package": "com.hjxh.huichang"},
    {"name": "慧聚", "package": "com.hjxh.huiju"},
    {"name": "慧览", "package": "com.hjxh.huilan"},
    {"name": "慧视", "package": "com.hjxh.huishi"},

    # ldcx 组
    {"name": "博识通", "package": "com.ldcx.boshitong"},
    {"name": "创享", "package": "com.ldcx.chuangxiang"},
    {"name": "丰知集", "package": "com.ldcx.fengzhiji"},
    {"name": "宏博视域", "package": "com.ldcx.hongboshiyu"},
    {"name": "宏途", "package": "com.ldcx.hongtu"},
    {"name": "华章", "package": "com.ldcx.huazhang"},

    # mqyc 组
    {"name": "笔端逸趣", "package": "com.mqyc.biduanyiqu"},
    {"name": "洞察派", "package": "com.mqyc.dongchapai"},
    {"name": "读启", "package": "com.mqyc.duqi"},
    {"name": "多维知迅", "package": "com.mqyc.duoweihzhixun"},
    {"name": "快晓", "package": "com.mqyc.kuaixiao"},
    {"name": "", "package": "com.mqyc.lingdongxuan"},

    # rkzx 组
    {"name": "便知", "package": "com.rkzx.bianzhi"},
    {"name": "畅览宝", "package": "com.rkzx.changlanbao"},
    {"name": "创意", "package": "com.rkzx.chuangyi"},
    {"name": "读秒", "package": "com.rkzx.dumiao"},
    {"name": "故事小径", "package": "com.rkzx.gushixiaojing"},
    {"name": "慧海", "package": "com.rkzx.huihai"},

    # xysj 组
    {"name": "必知", "package": "com.xysj.bizhi"},
    {"name": "低吟赏韵", "package": "com.xysj.diyinshangyun"},
    {"name": "读享便捷", "package": "com.xysj.duxiangbianjie"},
    {"name": "风絮", "package": "com.xysj.fengxu"},
    {"name": "简读宝", "package": "com.xysj.jiandubao"},
    {"name": "锦笺", "package": "com.xysj.jinqian"},

    # yymx 组
    {"name": "薄荷", "package": "com.yymx.bohe"},
    {"name": "畅知", "package": "com.yymx.changzhi"},
    {"name": "典阅读", "package": "com.yymx.dianyuedu"},
    {"name": "风雅", "package": "com.yymx.fengya"},
    {"name": "乐读坊", "package": "com.yymx.ledufang"},
    {"name": "乐章雅颂", "package": "com.yymx.lezhangyasong"},

    # ylq 组
    {"name": "畅读天地", "package": "com.ylq.changdutiandi"},
    {"name": "丰阅", "package": "com.ylq.fengyue"},
    {"name": "广聚", "package": "com.ylq.guangju"},
    {"name": "荟萃", "package": "com.ylq.huicui"},
    {"name": "今文", "package": "com.ylq.jinwen"},
    {"name": "聚闻", "package": "com.ylq.juwen"},

    # zl 组
    {"name": "触角", "package": "com.zl.chujiao"},
    {"name": "读知真章", "package": "com.zl.duzhizhenzhang"},
    {"name": "观微", "package": "com.zl.guanwei"},
    {"name": "绘知趣览", "package": "com.zl.huizhiqulan"},
    {"name": "极盟", "package": "com.zl.jimeng"},
    {"name": "集趣", "package": "com.zl.jiqu"},

    # zxhc 组
    {"name": "丰郇", "package": "com.zxhc.fengxun"},
    {"name": "慧点通", "package": "com.zxhc.huidiantong"},
    {"name": "简赅", "package": "com.zxhc.jianhai"},
    {"name": "快览", "package": "com.zxhc.kuanlan"},
    {"name": "澜途", "package": "com.zxhc.lantu"},
    {"name": "梦享家", "package": "com.zxhc.mengxiangjia"},

    # zycl 组
    {"name": "百闻思享", "package": "com.zycl.baiwensixiang"},
    {"name": "博阅启新", "package": "com.zycl.boyueqixin"},
    {"name": "琅见", "package": "com.zycl.langjian"},
    {"name": "望澜", "package": "com.zycl.zhixiangyue"},
    {"name": "文点趣", "package": "com.zycl.wendianqu"},
    {"name": "智享阅", "package": "com.zycl.wanglan"}
]

# 遍历输出数据
for item in apps:
    print(f"应用名称: {item['name']}, 包名: {item['package']}")
    payload = json.dumps({
        "title": item['name'],
        "group_id": 1,
        "logo": "",
        "organization_name": item['name'],
        "region": {
            "province": "",
            "city": "",
            "area": ""
        },
        "province": "",
        "city": "",
        "area": "",
        "address": "",
        "contact_name": "",
        "contact_phone": "",
        "contact_email": "",
        "status": 1,
        "remark": "",
        "code": item['package'],
        "company": "",
        "app_scheme": ""
    })
    headers = {
        'Authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ0ZXN0LnNoYW5nZ2V3YW5nd2wuY29tIiwiYXVkIjoidGVzdC5zaGFuZ2dld2FuZ3dsLmNvbSIsImlhdCI6MTc0ODU5MjA1NCwibmJmIjoxNzQ4NTkyMDU0LCJleHAiOjE3NDg2MTM2NTQsImp0aSI6eyJpZCI6MSwidXNlcm5hbWUiOiJhZG1pbiIsInR5cGUiOiJwYyJ9fQ.etapyiVFaJVtuZcKzDayBIEL_EguNNSgtp-ObQLMzyc',
        'Content-Type': 'application/json'
    }

    response = requests.request("POST", url, headers=headers, data=payload)

    print(response.text)
